<%@ Page Language="C#" AutoEventWireup="true" Inherits="Syrinx.Gui.AspNet.Nitobi2.NitobiBasePage" 
	 MasterPageFile="~/App_ThemeMasters/NoStyle/AdminOneColumnLayout.Master" %>
<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Nitobi2" TagPrefix="snc" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>

<!--#include file="~/SiteControls/RegisterStandardControls.txt"-->
<!--#include file="../SiteControls/StandardHeaderPageContent.inc"-->
<!--#include file="../SiteControls/StandardFooterPageContent.inc"-->

<asp:Content ContentPlaceHolderID="title" ID="c01" runat="server">
	<%SecurityPrivilege = "AppFunctions.ManageFileSystem"; %>
	<div class="left"><h1><asp:Label ID="_titLbl" runat="server" >File System</asp:Label></h1></div>
	<swf:BizProc ID="cache" runat="server" FactoryName="fileSysCache">
	</swf:BizProc>

	 <swf:BizProc runat="server" ID="directory" factoryName="fileSysDirectory">
		<State entireTree="false" includeSelf="true" />
		<ParentBizProc id="cache" fieldName="name" dataId="pid" />
	</swf:BizProc>
	<swf:BizProc runat="server" ID="file" FactoryName="fileSysFile">
		<ParentBizProc id="directory" fieldName="keyName" dataId="pid" />
		<ParentBizProc id="cache" fieldName="name" dataId="cache" />
	</swf:BizProc>
</asp:Content>

<asp:Content ContentPlaceHolderID="mainContent" ID="c02" runat="server">
	<table><tr>
	<td><asp:Label runat="server" ID="_ccLbl">File System Caches:</asp:Label></td>
	<td>
		<snc:Combo ID="caches" runat="server" ParentBizProcIds="cache" Mode="Classic" DataTextField="name">
			<Columns>
				<ntb:BoundColumn DataField="id" visible="false" />
				<ntb:BoundColumn DataField="name" HeaderText="Name" width="200" />
			</Columns>
		</snc:Combo>
	</td>
	</tr>
	</table>

	<table class="adminPageWidth">
	<tr><td>
		<snc:Grid ID="dirs" runat="server" Width="250px" Height="502px"  ShowToolbar="false" ParentBizProcIds="directory" Mode="LiveScrolling" AllowSorting="false" SelectionMode="Single" Resizable="Both">
			<Columns>
				<ntb:KeyColumn DataField="keyName" />
				<ntb:BoundColumn DataField="depthName" HeaderText="Name" width="200" />
				<ntb:BoundColumn DataField="fileCount" HeaderText="Num Files" width="40" />
			</Columns>
		</snc:Grid>
	</td><td class="adminRightContentWidth">
<script type="text/javascript">
	function toggleTabs(cId,c1, dId)
	{
		var a;
		for(i=1; ;i++)
		{
			a = document.getElementById(cId + i);
			b = document.getElementById(dId + i);
			if(a==null || a=='')
				break;
				
			if(i==c1)
			{
				a.className = 'currenttab';
				b.style.display = 'block';
			}
			else
			{
				a.className='';
				b.style.display = 'none';
			}
		}
		
	}
</script>
	<div class="clearer"></div>
<%--	<div class="tabs" style="padding-left:10px; padding-right:10px;">
        <div>
		    <ul>
		        <li id="t1" class="currenttab"><span><asp:HyperLink runat="server" ID="_tabs1" onclick="toggleTabs('t','1','ta')" NavigateUrl="javascript:;" Text="Directory Files"/></span></li>
		        <li id="t2"><span><asp:HyperLink runat="server" ID="_tabs2" onclick="toggleTabs('t','2','ta')" NavigateUrl="javascript:;" Text="Upload Files" /></span></li>
		        <li id="t3"><span><asp:HyperLink runat="server" ID="_tabs3" onclick="toggleTabs('t','3','ta')" NavigateUrl="javascript:;" Text="Directory Info" /></span></li>
		        <li id="t4"><span><asp:HyperLink runat="server" ID="_tabs4" onclick="toggleTabs('t','4','ta')"  NavigateUrl="javascript:;" Text="Cache Info" /></span></li>
	        </ul>
        </div>
    </div>
	<div class="clearer"></div>
--%>
		<div class="tabs" >
			<div>
				<ul>
					<li id="t1" class="currenttab"><div class="firstTab"><swf:DivLayers runat="server" ID="tl1" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs1" onclick="toggleTabs('t','1','ta')" NavigateUrl="javascript:;" Text="Directory Files"/></swf:DivLayers></div></li>
					<li id="t2"><swf:DivLayers runat="server" ID="tl2" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs2" onclick="toggleTabs('t','2','ta')" NavigateUrl="javascript:;" Text="Upload Files" /></swf:DivLayers></li>
					<li id="t3"><swf:DivLayers runat="server" ID="tl3" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs3" onclick="toggleTabs('t','3','ta')" NavigateUrl="javascript:;" Text="Directory Info" /></swf:DivLayers></li>
					<li id="t4"><div class="lastTab"><swf:DivLayers runat="server" ID="tl4" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs4" onclick="toggleTabs('t','4','ta')"  NavigateUrl="javascript:;" Text="Cache Info" /></swf:DivLayers></div></li>
				</ul>
			</div>
		</div>
		<div class="clearer"></div>
		<swf:DivLayers ID="mdl1" runat="server" SkinID="MainTabArea">

		<div id="ta1">
			<table><tr>
			<td>
				<span class="button5"><snc:ActionButton runat="server" ID="_mib1" Actions="file.DeleteBizObj" Text="Delete Selected" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
			</td>
			<td><asp:Label runat="server" ID="_mvLbl">Move Selected Files To:</asp:Label></td>
			<td>
				<snc:NitobiActionParamDropDown runat="server" id="moveAction" ParentBizProcIds="directory" Actions="file.Move" PageSize="50" DataTextField="keyName" Mode="Classic">
				 <TextBox Width="249px" /><List Width="250px" Height="400" />
					<Columns>
						<ntb:BoundColumn DataField="keyName" visible="false" />
						<ntb:BoundColumn DataField="keyName" HeaderText="Name" />
					</Columns>
				</snc:NitobiActionParamDropDown>
			</td>
			</tr></table>		
			<snc:Grid ID="fileGrid" runat="server" Width="575px" Height="450px" RowHeight="35" ShowToolbar="false" ParentBizProcIds="file" Mode="LiveScrolling" SelectionMode="Multi" Resizable="Both">
				<Columns>
					<ntb:KeyColumn DataField="id" />
					<ntb:ImageColumn DataField="gridImage" HeaderText="" width="40" />
					<ntb:BoundColumn DataField="gridName" HeaderText="Name" width="330" />
					<ntb:DateColumn DataField="dateCreated" HeaderText="Created On" width="120" />
					<ntb:NumberColumn DataField="size" HeaderText="Size" width="70" Mask="#,###" />
					<ntb:BoundColumn DataField="x" Width="25" />
				</Columns>
			</snc:Grid>
			
		</div>		
	
		<div id="ta2" style="display:none;">
		    <iframe width="400" height="300" src="FileUploadChild.aspx" frameborder="no" scrolling="auto">
		    </iframe>
		</div>

		<div id="ta3" style="display:none;">
			<span class="button1"><snc:ActionButton runat="server" ID="_mdb1" Actions="directory.AddBizObj" Text="Add" /></span>
			<span class="button6"><snc:ActionButton runat="server" ID="_mdb2" Actions="directory.UpdateBizObj" Text="Update" /></span>
			<span class="button1"><snc:ActionButton runat="server" ID="_mdb3" Actions="directory.CancelEdits" Text="Cancel" /></span>
			<span class="button5"><snc:ActionButton runat="server" ID="_mdb4" Actions="directory.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>

			<snc:NitobiBizObjDisplay ID="mdd1" runat="server" ParentBizProcIds="directory"
				ReadOnlyTemplate="Syrinx.Gui.AspNet.FileSysDirectoryDetailsDisplay" />
		</div>
		
		<div id="ta4" style="display:none;">
			<span class="button1"><snc:ActionButton runat="server" ID="_csb1" Actions="cache.AddBizObj" Text="Add" /></span>
			<span class="button6"><snc:ActionButton runat="server" ID="_csb2" Actions="cache.UpdateBizObj" Text="Update" /></span>
			<span class="button1"><snc:ActionButton runat="server" ID="_csb3" Actions="cache.CancelEdits" Text="Cancel" /></span>
			<span class="button5"><snc:ActionButton runat="server" ID="_csb4" Actions="cache.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
            <div class="clearer"></div>
			<snc:NitobiBizObjDisplay ID="cacheDet" runat="server" ParentBizProcIds="cache"
				ReadOnlyTemplate="Syrinx.Gui.AspNet.FileSysCacheDetailsDisplay" />				
		</div>
		</swf:DivLayers>
	</td></tr></table>
</asp:Content>

